<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddColumnUserSubscribe251007 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //用户表
        Schema::table('users', function (Blueprint $table){
            $table->integer('auth_subscribe')->index()->default(0)->comment('是否有授权模板消息');
        });

        //用户表
        Schema::table('user_subscribe', function (Blueprint $table){
            $table->integer('is_use')->index()->default(0)->comment('是否使用');
            $table->integer('is_allow')->index()->default(0)->comment('是否一直允许');
            $table->index(['user_id', 'status', 'is_use']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
